home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1999 January - Disc 2
/
Macworld (1999-01) (Disk 2).dmg
/
Serious Demos
/
Symbolic Composer 4.2
/
Environment
/
System
/
CADAR
/
Symbols
/
Other
/
change-every-n
< prev
next >
Wrap
Lisp/Scheme
|
1998-10-22
|
411b
|
22 lines
change-every-n
number-list which-positions-to-change-list change
changes every position in
which-positions-to-change-list by change
(setq number-list '(1 2 3 4 5 6 7))
->(1 2 3 4 5 6 7)
(setq changed-number-list
(change-every-n number-list '(2 4 6) 1))
->(1 3 3 5 5 7 7)
(setq another-changed-number-list
(change-every-n number-list
'(2 4 6) '(2 -1)))
->(1 4 3 3 5 8 7)